package com.wteam.dragon.shop.pojo.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.*;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import com.wteam.dragon.system.basebean.bean.BaseBean;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 优惠卷历史
 * @Author 陈晓辉
 * @Date 2021/4/8 16:45
 */
@Data
@Table
@TableName
@EqualsAndHashCode(callSuper = true)
public class CouponHistory extends BaseBean {
    @IsKey
    @IsNotNull
    @IsAutoIncrement
    @TableId(type = IdType.AUTO)
    @ColumnType(MySqlTypeConstant.BIGINT)
    @Column(comment = "自增id")
    private Long id;

    @IsNotNull
    @Column(comment = "对应的优惠卷id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long couponId;

    @IsNotNull
    @Column(comment = "优惠卷优惠码")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String couponCode;

    @Column(comment = "获取方式 (0 后台赠送 1 主动获取)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    private Integer getWay;

    @IsNotNull
    @Column(comment = "使用状态 (0 未使用 1 已使用 2 已过期)")
    @ColumnType(MySqlTypeConstant.TINYINT)
    @DefaultValue("0")
    private Integer useStatus;

    @Column(comment = "使用时间")
    @ColumnType(MySqlTypeConstant.TIMESTAMP)
    private Date useTime;

    @Column(comment = "对应的订单id")
    @ColumnType(MySqlTypeConstant.BIGINT)
    private Long orderId;

    @Column(comment = "对应的订单号码")
    @ColumnType(MySqlTypeConstant.VARCHAR)
    private String orderSn;
}
